<template>
  <div id="app">
 <!-- 路由占位符 -->
    <router-view/>
  </div>
</template>


<script>
import Index from '../src/views/Index'
export default {
  name:'app',
   mounted() {
    if (this.isMobile()) {
      this.$router.push("index_m");
    } else {
      this.$router.push("index");
    }
    
  },
   methods: {
    isMobile() {
      let flag = navigator.userAgent.match( // match方法可在字符串内检索指定的值，
        /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
      );
      // console.log(flag)
      return flag;

}
   }
  }

</script>

